package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.anno.AutoFill;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @program: sky-take-out
 * @description:
 * @author: fmp
 * @create: 2023-04-09 15:10
 * @Version 1.0
 **/
@Mapper
public interface DishMapper {

    Long selectById(Long id);

    //修改菜品
    @AutoFill(OperationType.UPDATE)
    void updateDish(@Param("dish") Dish dish);
    //根据id查询
    Dish SelectedDishById(@Param("id") Long id);
    //增加dish表的菜品信息
    @AutoFill(OperationType.INSERT)
    void insertDish(@Param("dish") Dish dish);
    //批量删除
    void deleteDishById(@Param("ids") List<Long> ids);
    //菜品分页查询
    Page<DishVO> SelectedDishPageQuery(@Param("dishPageQueryDTO") DishPageQueryDTO dishPageQueryDTO);
    //根据菜品分类查询菜品
    List<Dish> SelectedDishByCategoryId(@Param("categoryId") Long categoryId);


    List<Dish> selectStatus1DishByCategoryId(Long categoryId);

    Integer selectDishCountByStatus(Integer enable);
}
